package com.xingdata.jjxc.phonenavi;

import android.app.Activity;
import android.os.Bundle;

import com.amap.api.navi.AMapNavi;
import com.amap.api.navi.AMapNaviView;
import com.amap.api.navi.AMapNaviViewListener;
import com.xingdata.jjxc.R;
import com.xingdata.jjxc.map.navi.TTSController;

public class PhoneNaviActivity extends Activity implements AMapNaviViewListener {

	protected AMapNaviView mAMapNaviView;
	protected AMapNavi mAMapNavi;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_phone_navi);

		mAMapNaviView = (AMapNaviView) findViewById(R.id.navi_view);
		mAMapNaviView.onCreate(savedInstanceState);
		mAMapNaviView.setAMapNaviViewListener(this);

	}

	/**
	 * 如果使用无起点算路，请这样写
	 */
	private void noStartCalculate() {
		// 无起点算路须知：
		// AMapNavi在构造的时候，会startGPS，但是GPS启动需要一定时间
		// 在刚构造好AMapNavi类之后立刻进行无起点算路，会立刻返回false
		// 给人造成一种等待很久，依然没有算路成功 算路失败回调的错觉
		// 因此，建议，提前获得AMapNavi对象实例，并判断GPS是否准备就绪

	}

	// ////////////////////////////////////
	@Override
	protected void onResume() {
		super.onResume();
		mAMapNaviView.onResume();
	}

	@Override
	protected void onPause() {
		super.onPause();
		mAMapNaviView.onPause();

	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		mAMapNaviView.onDestroy();
		// since 1.6.0 不再在naviview destroy的时候自动执行AMapNavi.stopNavi();请自行执行
		mAMapNavi.stopNavi();
		mAMapNavi.destroy();
	}

	// ////////////////////////////////////

	@Override
	public void onLockMap(boolean arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean onNaviBackClick() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onNaviCancel() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onNaviMapMode(int arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onNaviSetting() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onNaviTurnClick() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onNextRoadClick() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onScanViewButtonClick() {
		// TODO Auto-generated method stub

	}

	@Override
	public void onNaviViewLoaded() {
		// TODO Auto-generated method stub
		
	}
}
